package com.hospital.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.*;
import java.util.Date;

@Data
public class Employee {
    @NotNull(message = "id不得为空")
    private int employee_id;

    @NotEmpty(message = "password不得为空")
    private String employee_password;

    @NotEmpty(message = "name不得为空")
    private String employee_name;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "生日不得为空")
    private Date employee_birth;

    @NotNull(message = "gender不得为空")
    private int employee_gender;


    @NotEmpty(message = "phone不得为空")
    @Pattern(regexp = "\\d{11}", message = "电话格式错误")
    private String employee_phone;

    @NotNull(message = "office_id不得为空")
    private int office_id;

    @NotNull(message = "position不得为空")
    private int employee_position;

    @NotNull(message = "grade不得为空")
    private int employee_grade;
}
